//package com.youhui.weixin.utils;
//
//import com.google.zxing.*;
//import com.google.zxing.common.HybridBinarizer;
//
//import com.google.zxing.client.j2se.BufferedImageLuminanceSource;
//
//import javax.imageio.ImageIO;
//import java.awt.image.BufferedImage;
//import java.io.File;
//import java.io.IOException;
//import java.util.HashMap;
//
///**
// * Created by https://github.com/kuangcp on 17-9-28  上午10:43
// * 二维码工具类
// */
//public class QRCodeUtils {
//
//    /**
//     * 读取绝对路径下的二维码图片
//     * @param path 绝对路径
//     * @return 返回二维码文本，失败返回null
//     */
//    public static String readQRCodeFromFile(String path){
//        try {
//            MultiFormatReader formatReader = new MultiFormatReader();
////            File file = new File(path);
//            BufferedImage image = ImageIO.read(new File(path));
//            BinaryBitmap binaryBitmap = new BinaryBitmap(new HybridBinarizer(new BufferedImageLuminanceSource(image)));
//            @SuppressWarnings("rawtypes")
//            HashMap hints = new HashMap();//创建属性
//            hints.put(EncodeHintType.AZTEC_LAYERS, "utf-8");//设置编码
//            Result result = formatReader.decode(binaryBitmap,hints);
//            System.out.println(result.toString());
//            return result.toString();
//        } catch (NotFoundException | IOException e) {
//            e.printStackTrace();
//            return null;
//        }
//    }
//}
